Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dashboard syncing in background goroutine #44

Closed
wants to merge 2 commits into from
Closed

Conversation

sd2k
Copy link
Contributor

@sd2k sd2k commented Sep 13, 2023

This adds an option of running the dashboard syncing process inside the plugin in a background goroutine.

The big disadvantage is that the process isn't started until the first time the plugin is called for any reason, e.g. a health check or a metrics call. (This might actually help if we did end up choosing to run this in cloud though, because we could have better control over when the processes started running, rather than it just being arbitrary depending when the Grafana instance restarts).

It's good enough to run once and get some data synchronised into qdrant/vectorapi, at least! To test, run mage && npm install && npm build && docker-compose up -d --build locally then:

$ # Build the plugin
$ mage
$ npm install
$ npm run build
$ # Start Grafana and qdrant
$ docker-compose up -d --build
$ # Send a request to search for dashboards. The first request will start the sync.
$ curl http://admin:admin@localhost:3000/api/plugins/grafana-llm-app/resources/vector/search -d '{"collection": "grafana.core.dashboards", "text": "Mimir usage"}'
{"results":[{"payload":{"description":null,"panels":[{"description":"CPU usage of Mimir","title":"CPU usage"}],"title":"Mimir resource usage"},"score":0.7932371497154236}]}

Base automatically changed from vector-service-qdrant to vector-service September 13, 2023 15:10
@sd2k sd2k force-pushed the vector-sync-2 branch 2 times, most recently from 570c8f2 to 4ecf1dd Compare September 14, 2023 09:14
Base automatically changed from vector-service to main September 14, 2023 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant